package com.bwie.controller;


import com.bwie.pojo.Goods;
import com.bwie.service.GoodsService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lenovo
 */
@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Autowired
    private GoodsService goodsService;

    /***
     * @description:列表
     * @author: sxting~😊
     * @Date: 2024/10/8 11:12
     * @param:
     * @return:
     **/
    @PostMapping("/list")
    public R list(@RequestBody PageInfoVo pageInfoVo){
        return goodsService.goodsList(pageInfoVo);
    }
    /***
     * @description:添加商品
     * @author: sxting~😊
     * @Date: 2024/10/8 11:12
     * @param:
     * @return:
    **/
    @PostMapping("/add")
    public R add(@RequestBody Goods goods){
        return goodsService.addGoods(goods);
    }


}
